package New;

import java.util.Scanner;

/**
 * 形如 sum = 2+22+222+2222+22222,a=2,n=5,a,n均从键盘输入
 * 求 sum
 */
public class Banana {
    public static void main(String[] args)  {
        System.out.println("输入a的值");
     int  a = new Scanner(System.in).nextInt();
        System.out.println("输入n的值");
     int  n = new Scanner(System.in).nextInt();
     double sum = 0;
//    s=2+22+222+2222+22222
        for (double i = a; i <=Math.pow(10,n); i=i*10+a) {
            sum+=i;
        }
        System.out.println(sum);
    }

}
